package com.gd.iot.energy.pojo.datapush.ctwing.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * 设备响应
 *
 * <p>
 *  {
 * 	"tenantId": "1",
 * 	"productId": "1503",
 * 	"messageType": "commandResponse",
 * 	"deviceId": "2d1f1a708b5d4cef880937d67b5e5842",
 * 	"taskId": 1,
 * 	"result": {
 * 		"resultCode": "SUCCESSFUL",
 * 		"resultDetail": {
 * 			"Length": 2,
 * 			"Rspdata": "Qkg="
 *      }
 *   }
 * }
 * </p>
 *
 * @author kris
 * @date Created at 8:35 上午 2020/8/29
 */
@Setter
@Getter
@ToString
public class DeviceResponseDTO {

    /**
     * 租户ID
     */
    private String tenantId;

    /**
     * 产品ID
     */
    private String productId;

    /**
     * 设备ID
     */
    private String deviceId;

    /**
     * 消息类型=commandResponse
     */
    private String messageType;

    /**
     * 指令任务ID
     */
    private String taskId;

    /**
     * 	指令执行结果，其中：resultcode为指令执行状态
     * 	（SUCCESSFUL:成功，SENT:已发送, DELIVERED:已送达, FAILED:失败）；resultdetail为指令执行结果
     */
    private Result result;

    @Setter
    @Getter
    @ToString
    public static class Result{
        private String resultCode;
        private ResultDetail resultDetail;
    }

    @Setter
    @Getter
    @ToString
    public static class ResultDetail{

        @JsonProperty("Length")
        private Integer length;

        @JsonProperty("Rspdata")
        private String rspdata;
    }
}
